import java.text.DecimalFormat;


public class Items {

	//type 1
	double book;
	//type 2
	double music_CD;
	//type 3
	double chocolat_bar;
	//type 4
	double imported_box_of_chocolates;
	//type 5
	double imported_bottle_of_perfume;
	//type 6
	double bottle_of_perfume;
	//type 7
	double headache_pills;
	//The total tax
	double tax;


	
	public Items(){
		this.book = 0;
		this.music_CD = 0;
		this.chocolat_bar = 0;
		this.imported_box_of_chocolates = 0;
		this.imported_bottle_of_perfume = 0;
		this.bottle_of_perfume = 0;
		this.headache_pills = 0;
		this.tax = calculate_tax();
	}
	public Items(int type, double money){
		switch (type) {
		case 1:
			this.book += money;
			break;
		case 2:
			this.music_CD += money;
			break;
		case 3:
			this.chocolat_bar +=money;
			break;
		case 4:
			this.imported_box_of_chocolates += money;
			break;
		case 5:
			this.imported_bottle_of_perfume += money;
			break;
		case 6:
			this.bottle_of_perfume += money;
			break;
		case 7:
			this.headache_pills += money;
			break;
		default:
			break;
		}
	}
	
	private double calculate_tax(){
		double tax = 0.1*this.music_CD + 0.05*this.imported_box_of_chocolates 
				+ 0.15*this.imported_bottle_of_perfume + 0.1*this.bottle_of_perfume;
		DecimalFormat dF = new DecimalFormat(".##");
		String to_return = dF.format(tax);
		
		return tax;
		
	}
	
}
